﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.IO;
using System.Windows.Media;
using System.Globalization;
using System.Windows;

namespace ResourceViewerExtension.Common
{
    public class ShortenPathConverter : IMultiValueConverter
    {

        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string formattedPath = "";
            if (string.IsNullOrEmpty(values[0] as string) || values[1] == null)
                return formattedPath;

            string pathname = (string)values[0];
            double width = (double)values[1];

            formattedPath = ShortenPathHelper.ShortenPath(pathname, width);

            return formattedPath;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
